﻿/*版权声明
 * 
 * 本 WebName:IMIS_ERP 由
 * 河北大学 信管团队 开发
 * 如有任何疑问请联系开发人员
 * 
 * 项目开发者
 * 负责人：朱胜贤
 * 成员：水亚亚、孙旭峰、张文元、项玥、吕芳、吴凡、谢静、李亚慧
 * 
 * 如有任何疑问请联系：河北大学信管团队
 * QQ：196396337
 * Email:zagelover@163.com
 * HomePage：http://sxgzs.com/
 * 
 * CopyRight (c) 河北大学信管团队 2010~2020
 */

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace IMIS_ERP.Web.Factory_People
{
    public partial class Add_Mine : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                FillInfo();
            }
        }

        protected void btnSave_Click(object sender, EventArgs e)
        {

            IMIS_ERP.Model.Factory_People model = new IMIS_ERP.Model.Factory_People();
            model.fpID = this.txtfpID.Text.Trim();
            model.fpName = this.txtfpName.Text.Trim();
            model.fpPwd = IMIS_ERP.BLL.Assistant.AddToMD5(this.txtfpPwd.Text.Trim());
            model.fpContacts = this.txtfpContacts.Text.Trim();
            model.fpType = this.chkfpType.SelectedValue.ToString();
            model.fpFiID = this.txtfpFiID.Text.Trim();
            model.fpInfo = this.txtfpInfo.Text.Trim();
            IMIS_ERP.BLL.Factory_People bll = new IMIS_ERP.BLL.Factory_People();
            if (bll.Add(model))
            {
                if (ckbContinue.Checked)
                {
                    lblMessage.Text = "添加信息成功";
                }
                else
                {
                    Response.Redirect("List_Mine.aspx?msg=a");
                }
            }
            else
            {
                lblMessage.Text = "添加信息失败,请重试";
            }

        }
        /// <summary>
        /// 填充加工中心信息
        /// </summary>
        private void FillInfo()
        {
            //IMIS_ERP.BLL.Factory_Info bll = new BLL.Factory_Info();
            //IMIS_ERP.BLL.Factory_People bll = new BLL.Factory_People();
            string id = Session["fiId"].ToString();
            ////bll.GetAllList();
            //txtfpFiID.DataSource = ds;
            //txtfpFiID.DataValueField = "fiID";
            //txtfpFiID.DataTextField = "fiName";
            //txtfpFiID.DataBind();
            txtfpFiID.Text = id;
            txtfpID.Text = id;


        }

      
    }
}
